Brief Full Advanced Search Search Tips
|  |  | To access the contents, click the chapter and section titles. Visual Basic 6 Programming Blue Book: The Most Complete, Hands-On Resource for Writing Programs with Microsoft Visual Basic 6! (Publisher: The Coriolis Group) Author(s): Peter G. Aitken ISBN: 1576102815 Publication Date: 08/01/98 Search this book:
Previous | Table of Contents | Next
Preparing a Visual Basic program for distribution consists of two parts: You must create the setup program that the end user runs to install your program; you must package the program and its setup files so they can be placed on diskettes, a CD-ROM, or the Internet. The setup program is normally created automatically for you, but you have the option of customizing it. Packaging of the program files is accomplished by the Package and Deployment Wizard.
Table 26.2 Visual Basic’s Step commands.
Command | When Program Has Not Yet Started | When Program Is Paused At A Breakpoint | Shortcut Key
--- | --- | --- | ---
Step Into | Executes the first statement. If the first statement is a procedure call, pauses at the first statement in the procedure. | Executes the next statement. If the next statement is a procedure call, pauses at the first statement in the procedure. | F8
Step Over | Executes the first statement. If the first statement is a procedure call, executes all statements in the procedure, and pauses at the first statement following the procedure. | Executes the next statement. If the next statement is a procedure call, executes all statements in the procedure and pauses at the first statement following the procedure. | Shift+F8
Step Out | Not available. | If execution is paused in a procedure, executes the remainder of the procedure and pauses at the first statement following the procedure. | Ctrl+Shift+F8
#### Creating The Setup Program As with most Windows programs, a Visual Basic program is installed by running SETUP.EXE. When you create a distribution package for a Visual Basic program, SETUP.EXE is automatically included as part of the package. This program has basically only one function: to execute the program SETUP1.EXE. This may seem like a strange way to do things, but there is a reason behind it. While SETUP is fixed and cannot be changed, you can customize SETUP1 to meet the specific setup requirements of your program. In fact, SETUP1 is itself a Visual Basic program, located in the folder \VB98\WIZARDS\PDWIZARD\SETUP1. Here’s how it works: When you run the Package and Deployment Wizard (covered later in the chapter), it includes SETUP1.EXE, which will be included in your program’s distribution package. If you have customized and compiled SETUP1, your changes will be included; otherwise, the default version is used. When would you need to customize SETUP1? To be honest, almost never. I have written and distributed quite a few Visual Basic programs, and I have not needed to do so even once. The possibility does exist, however. For example, you might want to give your users the option of either installing a large Help file to their hard disk or running it from the distribution CD-ROM. The basic procedure for customizing SETUP1 is as follows: 1. Open the SETUP1 project. 2. Create one or more new forms to display information and collect user responses about the available installation options. 3. Select the form frmSetup1 and display the code in the Form_Load procedure. 4. Locate the call to the procedure ShowBeginForm. Immediately after this call, add code to display your option dialog boxes. For simple options, you may be able to use the MsgBox function to input Yes/No answers. 5. Add code to the Form_Load procedure as required by your installation options. You will find comments interspersed in the source code explaining what exactly needs to be added. 6. Compile the SETUP1 project to create SETUP1.EXE. 7. Run the Package and Deployment Wizard to create a distribution package for your program. 8. Locate the SETUP.LST file that was created by the wizard. This file contains information about the files and icons that are part of the program installation. Use any text editor, such as WordPad, to make necessary additions and changes to this file. You’ll find more detailed information on editing SETUP.LST and other aspects of customizing the setup program in the online Visual Basic Help system. It is not a difficult process, and as I have mentioned, it is something you will rarely need to do. Remember, whether or not you customize your setup, be sure to test it thoroughly before distributing it. #### The Package And Deployment Wizard The Package and Deployment Wizard (or PD Wizard) is on the same level as sliced bread and indoor plumbing in terms of being a great thing. Assembling all the files needed to distribute your Visual Basic application and packaging them for distribution would be a miserable task without this tool. You can run the PD Wizard either as an add-in in Visual Basic or as a standalone. To run it as an add-in, use the Add-In Manager (select Add-In Manager from the Add-Ins menu in Visual Basic) to load the PD Wizard. Load the project you want to package/distribute into Visual Basic, then run the PD Wizard from the Add-Ins menu. To run it as a standalone, execute the file PDCMDLN.EXE. In either case, when the program starts, you’ll see the opening screen shown in Figure 26.5. Figure 26.5 The PD Wizard’s opening screen. As the name suggests, the PD Wizard has two functions: • Packaging your program—Determining which files are needed and combining them and the setup program into a compressed form. Packaging can also include the process of copying distribution files to diskettes. • Deploying this package—Moving it to a network or Internet site where people can access it. These two functions are accessed via the corresponding buttons on the PD Wizard’s opening screen. The third button, Manage Scripts, is used to work with scripts that let you automate some of the PD Wizard’s functions for repetitive tasks. I will not be dealing with script management in this book. Packaging Your Application You have several distribution options when packaging your application: • Distributing the program on multiple diskettes, splitting files that are too large to fit onto a single diskette. • Placing the distribution files in a hard-disk directory for distribution over a network or mastering onto CD-ROM. • Distributing your application across the Internet using the automatic code download capability of Microsoft Internet Explorer.
Previous | Table of Contents | Next

| Products | Contact Us | About Us |